import request from '@/utils/request'
import type { AxiosResponse } from 'axios'
// const serviceUrl = import.meta.env.VITE_API_BASE_URL
const authUrl = import.meta.env.VITE_AUTH_BASE_URL
// 封装 GET 请求
export const login = (data?: object): Promise<AxiosResponse> => {
  return request({
    baseURL: authUrl,
    url: '/auth/login',
    method: 'post',
    data
  })
}

export const getUserInfo = (): Promise<AxiosResponse> => {
  return request({
    baseURL: authUrl,
    url: '/auth/getUserInfo',
    method: 'get'
  })
}

export const getMenus = (): Promise<AxiosResponse> => {
  return request({
    baseURL: authUrl,
    url: `/auth/getMenus`,
    method: 'get'
  })
}
